﻿package com.quickdev.intelligenthome.content {
	
	import flash.display.MovieClip;
	
	
	public class Content extends MovieClip {
		private var contentArr :Array = ["energyTotalContent", "smsContent", "lightContent", "curtainContent", "doorWindowContent", "photovoltaicContent", "powerSocketContent", "conditionerContent"];
		
		public function Content() {
			// constructor code
		}
		
		public function hideContentAt(index :uint) :void {
			if( contentArr[ index ] ) {
				this[contentArr[ index ]].visible = false;
			}
		}
		
		public function hideAll() :void {
			for(var i :uint = 0; i < contentArr.length; ++i) {
				hideContentAt( i );
			}
		}
		
		public function showContentAt(index :uint) :void {
			if( contentArr[index] ) {
				hideAll();
				this[contentArr[index]].visible = true;
			}
		}
	}
	
}
